<?php

class FieldsAdmin
{
    private $_db;
    private $tableName;
    
    public function __construct()
    {
        $this->_db = Db::getInstance();
    }
    
    public function addField($name, $nameId, $value ,$type)
    {
        $this->_db->q("insert into `fields` (name, nameId, type, value) values ('".$name."', '".$nameId."', '".$type."', '".$value."')");
    }
    
    public function deleteField($field)
    {
        $this->q("delete from `fields` where `id` = ".$field);
        
    }
    
    public function updateField($field, $newName)
    {
        $this->q("update `fields` set name = ".$newName." where `id` = ".$field);
    }
}

?>
